package edu.xhu.behavior.controller;

import edu.xhu.behavior.service.BiliUserDanmuService;
import edu.xhu.model.common.dtos.ResponseResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;


@Api(value = "bilibili弹幕", tags = "bilibili弹幕")
@CrossOrigin
@RestController
@RequiredArgsConstructor
@RequestMapping("/behavior")
public class DanMuController {

    private final BiliUserDanmuService biliUserDanmuService;

    /**
     * 获取弹幕列表
     */
    @ApiOperation("根据视频id,获取弹幕列表")
    @GetMapping("/danmu/list")
    public ResponseResult<?> getDanmuList(@RequestParam("videoId") Long videoId) {
        return biliUserDanmuService.getDanmuList(videoId);
    }

    /**
     * 删除弹幕
     */
    @ApiOperation("根据弹幕id,删除弹幕")
    @PostMapping("/danmu/delete")
    public ResponseResult<?> deleteDanmu(@RequestParam("dmId") Long dmId) {
        return biliUserDanmuService.deleteDanmu(dmId);
    }

}
